﻿@model BookShop3Tables.Models.Author

@{
    ViewBag.Title = "Details";
}

<h2>Details</h2>

<fieldset>
    <legend>Author</legend>

    <div class="display-label">FirstName</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.FirstName)
    </div>

    <div class="display-label">LastName</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.LastName)
    </div>
    <div class="display-field">
        <table>
            <tr>
                <th>Book Title</th>
                <th>Name of the Set</th>
                <th>Price</th>
            </tr>
            @foreach (var item in Model.Books)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.Name)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Saga)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Price)
                    </td>
                </tr>
            }
        </table>
    </div>
</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id=Model.PersonID }) |
    @Html.ActionLink("Back to List", "Index")
</p>
